<template>
  <a-modal
    :title="title"
    :visible="visible"
    :confirm-loading="confirmLoading"
    cancel-text="关闭"
    @ok="submit"
    @cancel="closeModal"
  >
    <a-spin :spinning="confirmLoading">
      <p class="title_text">你确定要转为待审核？</p>
    </a-spin>
  </a-modal>
</template>

<script>
import ApiTree from '@/api/merchant/merchantList';
import { Slime } from '@/mixins/slime';
export default {
  name: 'waitCheckModal',
  data() {
    return {
      title: '转为待审核',
      merchantId: null,
    };
  },
  mixins: [Slime],
  methods: {
    // 详情
    open(merchantId) {
      this.merchantId = merchantId
      this.visible = true;
    },
    // 提交
    submit() {
      this.confirmLoading = true;
      this.submitUpdate();
    },
    // 提交 改
    submitUpdate() {
      let param = {
        merchantId: this.merchantId, //这里记得修改
      };
      ApiTree.detailWaitCheck(param)
        .then((res) => {
          if(res.code == 0){
            this.$message.success('操作成功');
          }else{
            this.$message.warning(res.message);
          }
        })
        .finally(() => {
          this.closeModal();
        });
    },
    // 弹窗-关闭
    closeModal() {
      this.confirmLoading = false;
      this.visible = false;
      this.$emit('closeModal');
    },
  },
};
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
.title_text{
  font-size: 14px;
  font-weight: 800;
  color: #000;
}
</style>